CREATE TABLE [dbo].[TDCANJ_CLIE]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[CO_CLIE] [dbo].[TD_VC_020] NOT NULL,
[NU_CANJ] [dbo].[TD_VC_008] NOT NULL,
[FE_CANJ] [dbo].[TD_DT_001] NOT NULL,
[NU_SECU_CANJ] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TDCANJ_CL__NU_SE__46136164] DEFAULT ((0)),
[NU_ORDE_LETR] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TDCANJ_CL__NU_OR__4707859D] DEFAULT ((0)),
[NU_LETR_CLIE] [dbo].[TD_VC_020] NULL,
[CO_TIPO_DOCU] [dbo].[TD_VC_003] NULL,
[NU_DOCU_CLIE] [dbo].[TD_VC_020] NULL,
[IM_DOCU] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCANJ_CL__IM_DO__47FBA9D6] DEFAULT ((0)),
[IM_SALD_DOCU] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCANJ_CL__IM_SA__48EFCE0F] DEFAULT ((0)),
[IM_SALD_CONV] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCANJ_CL__IM_SA__49E3F248] DEFAULT ((0)),
[IM_DETA] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCANJ_CL__IM_DE__4AD81681] DEFAULT ((0)),
[IM_DETA_NEGA] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCANJ_CL__IM_DE__4BCC3ABA] DEFAULT ((0)),
[IM_CONV_DOCU] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCANJ_CL__IM_CO__4CC05EF3] DEFAULT ((0)),
[ST_CIER_DOCU] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TDCANJ_CL__ST_CI__4DB4832C] DEFAULT ('N'),
[IM_CANJ_MDOC] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCANJ_CL__IM_CA__4F9CCB9E] DEFAULT ((0)),
[IM_CANJ_MCAN] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCANJ_CL__IM_CA__5090EFD7] DEFAULT ((0)),
[CO_ESTA_ORIG] [dbo].[TD_VC_003] NULL,
[ST_NDEB_AUTO] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TDCANJ_CL__ST_ND__51851410] DEFAULT ('N'),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDCANJ_CL__CO_US__536D5C82] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDCANJ_CL__FE_US__546180BB] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDCANJ_CL__CO_US__5555A4F4] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDCANJ_CL__FE_US__5649C92D] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDCANJ_CLIE] WITH NOCHECK ADD CONSTRAINT [CK__TDCANJ_CL__ST_CI__4EA8A765] CHECK NOT FOR REPLICATION (([ST_CIER_DOCU]='N' OR [ST_CIER_DOCU]='S'))
GO
ALTER TABLE [dbo].[TDCANJ_CLIE] WITH NOCHECK ADD CONSTRAINT [CK__TDCANJ_CL__ST_ND__52793849] CHECK NOT FOR REPLICATION (([ST_NDEB_AUTO]='N' OR [ST_NDEB_AUTO]='S'))
GO
ALTER TABLE [dbo].[TDCANJ_CLIE] ADD CONSTRAINT [PK__TDCANJ_C__07789D370A495B77] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_UNID_CONC], [CO_CLIE], [NU_CANJ], [FE_CANJ], [NU_SECU_CANJ]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDCANJ_CLIE] ADD CONSTRAINT [FK__TDCANJ_CLIE__314E19FF] FOREIGN KEY ([CO_EMPR], [CO_UNID_CONC], [CO_CLIE], [NU_CANJ], [FE_CANJ]) REFERENCES [dbo].[TCCANJ_CLIE] ([CO_EMPR], [CO_UNID_CONC], [CO_CLIE], [NU_CANJ], [FE_CANJ])
GO
